import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/auth/login', // '/vue-element-admin/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/auth/info', // '/vue-element-admin/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/auth/logout', //'/vue-element-admin/user/logout',
    method: 'post'
  })
}

export function getUserList(params) {
  return request({
    url: `/user/search`,
    method: 'post',
    headers:{ 'Content-Type':'application/json'},
    data:JSON.stringify(params)
  })
}

export function assignUserRoles(data) {
  return request({
    url: `/user/update/roles`,
    method: 'post',
    data
  })
}

export function importTeach(data) {
  return request({
    url: '/user/importTeach', // '/vue-element-admin/user/login',
    method: 'post',
    data
  })
}


export function importStudent(data) {
  return request({
    url: '/user/importStudent', // '/vue-element-admin/user/login',
    method: 'post',
    data
  })
}


export function addUser(data) {
  return request({
    url: '/user/addUser', // '/vue-element-admin/user/login',
    method: 'post',
    data
  })
}

export function deleteUser(data) {
  return request({
    url: '/user/deleteUser', // '/vue-element-admin/user/login',
    method: 'post',
    data
  })
}
export function getStudentList(data) {
  return request({
    url: '/user/getStudentList', 
    method: 'post',
    data
  })
}

export function updateUser(data) {
  return request({
    url: '/user/updateUser', 
    method: 'post',
    data
  })
}

export function getUser(data) {
  return request({
    url: '/user/getUser', 
    method: 'post',
    data
  })
}

export function getUserReportInfo(data) {
  return request({
    url: '/user/getUserReportInfo', 
    method: 'post',
    data
  })
}